Conditions | 1 |
Paths | 1 |
Total Lines | 32 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | 'use strict' |
||
7 | export default function (server) { |
||
8 | server.post({ |
||
9 | name: 'password//changed', |
||
10 | path: '/password_changed', |
||
11 | validation: { |
||
12 | schema: { |
||
13 | body: Joi.object({ |
||
14 | password: Joi.string() |
||
15 | .min(6) |
||
16 | .max(15) |
||
17 | .required(), |
||
18 | password_confirmation: Joi.any() |
||
19 | .valid(Joi.ref('password')) |
||
20 | .required() |
||
21 | }).required() |
||
22 | }, |
||
23 | options: { |
||
24 | joiOptions: { |
||
25 | allowUnknown: true |
||
26 | }, |
||
27 | errorResponder (transformedErr, req, res, next) { |
||
28 | req.ifError = transformedErr |
||
29 | return next() |
||
30 | } |
||
31 | } |
||
32 | } |
||
33 | }, |
||
34 | passport.authenticate('jwtBodyFieldStrategy', { |
||
35 | session: false |
||
36 | }), |
||
37 | passwords.update) // change password |
||
38 | } |
||
39 |